﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Member_Address : OTS.MemberPage
{
    OTS.Model.custom custom = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!TestLogin(HttpContext.Current))
            return;
        custom = GetCustom(HttpContext.Current);
        if (!Page.IsPostBack)
        {

            BindContent( );
        }
    }
    private void BindContent()
    {
        OTS.BLL.DeliverAddressBLL bll = new OTS.BLL.DeliverAddressBLL();
        this.rpContent.DataSource = bll.GetCustomAddress(custom.cusID);
        this.DataBind();
    }
 
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string strID = this.txtID.Text;
        if (OTS.Common.Help.IsNumber(strID))
        {
            OTS.BLL.DeliverAddressBLL bll = new OTS.BLL.DeliverAddressBLL();
            if (bll.Delete(int.Parse(strID), custom.cusID))
            {
                BindContent();
            }

        }
    }
}
